Skip to content

Parser: Friendly token names in Unexpected Token error messages#194

Merged
marcoroth merged 4 commits into
mainfrom
friendly-token-names
Mar 1, 2026
Merged

Parser: Friendly token names in Unexpected Token error messages#194
marcoroth merged 4 commits into
mainfrom
friendly-token-names

Conversation

@marcoroth

@marcoroth marcoroth commented Jun 30, 2025

Copy link
Copy Markdown
Owner

This pull request changes the parser's error messages from technical token names to user-friendly format.

Before:

Unexpected Token. Expected: `TOKEN_IDENTIFIER, TOKEN_AT, TOKEN_ERB_START,TOKEN_WHITESPACE, or TOKEN_NEWLINE`, found: `TOKEN_COLON`.

After:

Unexpected Token. Expected: an identifier, `@`, `<%`, whitespace, or a newline, found: `:`.

Format conventions

  • Literal tokens (punctuation/delimiters) are backtick-quoted: `<`, `<%`, `@`, `:`
  • Abstract tokens use natural English with articles: an identifier, a quote, whitespace, end of file
  • Lists use Oxford comma: an identifier, @, or <%

@marcoroth marcoroth changed the title Friendly token names in Unexpected Token error messages Parser: Friendly token names in Unexpected Token error messages Oct 13, 2025
@marcoroth marcoroth force-pushed the friendly-token-names branch from 8905a7a to 4b40f7d Compare March 1, 2026 04:36
@marcoroth marcoroth marked this pull request as ready for review March 1, 2026 04:39
@pkg-pr-new

pkg-pr-new Bot commented Mar 1, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@194
npx https://pkg.pr.new/@herb-tools/language-server@194
npx https://pkg.pr.new/@herb-tools/linter@194

commit: 2df5ca8

@github-actions

github-actions Bot commented Mar 1, 2026

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 2df5ca8


✅ Preview deployment has been cleaned up.

@marcoroth marcoroth merged commit 7dfee03 into main Mar 1, 2026
32 checks passed
@marcoroth marcoroth deleted the friendly-token-names branch March 1, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant